﻿// =====================================================================
// <copyright file="ExpressionExtensionsTest.cs" author="David R. Guindo">
// 	Copyright (C) 2013. All rights reserved.
// </copyright>
// =====================================================================
// This code is released under the terms of the Apache 2.0 license, 
// http://apache.org/licenses/LICENSE-2.0.html
// =====================================================================

namespace AppBlock.Core.Test.Extensions
{
    using System;
    using System.Linq.Expressions;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class ExpressionExtensionsTest
    {
        [TestMethod]
        public void ExpressionExtensions_PropertyName_Test()
        {
            var e = new DateTime();
            Assert.AreEqual(ExpressionExtensions.PropertyName(() => e.Date), "Date");
        }

        [TestMethod]
        public void ExpressionExtensions_PropertyName_Action_Test()
        {
            Assert.AreEqual(ExpressionExtensions.PropertyName((DateTime u) => u.Date), "Date");
        }
    }
}